import {cdnRequest, oauthRequest} from "@/utils/HttpRequest";




export async function findByDevise(menuId:number) {
  //SwaggerResources
  let attrkey = "findByDevisekey" + menuId;
  return new Promise<API.BaseDataResult<API.DeviseInfo>>((resolve, reject) => {
    let items = localStorage.getItem(attrkey);
    if (items) {

      var parse = JSON.parse(items);

      resolve(parse)
    } else {
      oauthRequest<API.BaseDataResult<API.DeviseInfo>>(
        "devise/findByDevise", {
          method: "GET",
          data: {menuId: menuId}
        }).then((res) => {
        localStorage.setItem(attrkey, JSON.stringify(res))
        resolve(res)
      }).catch(e => {
        reject(e)
      })
    }
  })



}

